﻿/* Font 扩展类
 */

/*待测试*/
namespace LSLib.Drawing
{
    using System.Drawing;
    using System.Drawing.Text;

    public class FontEx
    {
        /// <summary>判断指定字体是否存在
        /// </summary>
        public static bool IsExistedFontsByFontName(string fontName)
        {
            if (string.IsNullOrEmpty(fontName)) return false;

            System.Drawing.Text.InstalledFontCollection myFont = new InstalledFontCollection();

            foreach (FontFamily font in myFont.Families)
            {
                if (font.Name == fontName) return true;
            }
            return false;
        }
    }
}
